package com.ag.lzw.dao;

import java.util.List;

import com.ag.bean.TbEvent;
import com.ag.dao.TbEventDAO;

public class LzwTbEventDAO extends TbEventDAO {

	public List findEventLeader(String eid){
		String hql = "From TbEvent as te left join fetch te.tbUserByTbUId where te.EId = '"+eid+"'";
		return this.getHibernateTemplate().find(hql);
	}

	public TbEvent findAEventById(String id){
		String hql = "From TbEvent as te left join fetch te.tbUserByTbUId tbu where te.EId = '"+id+"'";
		List<TbEvent> tes = this.getHibernateTemplate().find(hql);
		TbEvent event = null;
		for(TbEvent te : tes){
			if(te!=null){
				event = te;
			}
		}
		return event;
	}
}
